<template>
	<view class="container">
		<div class="menu-list">
			<button @click="toPaperList('1')" type="button" class="button">知识点</button>
			<button @click="toPaperList('2')" type="button" class="button uni-mt-6">练习卷</button>
			<button @click="toPaperList('3')" type="button" class="button uni-mt-6">测试卷</button>
			<button @click="toPaperList('5')" type="button" class="button uni-mt-6">历年真题</button>
			<button @click="toPaperList('6')" type="button" class="button uni-mt-6">模拟试卷</button>
			<button @click="toPaperList('4')" type="button" class="button uni-mt-6">错题卷</button>
			<button @click="toErrrQuestionList" type="button" class="button uni-mt-6">错题收藏</button>
			
			<button @click="logout" type="primary" class="button logout">退出登陆</button>
		</div>
	</view>
</template>

<script setup lang="ts">
import { navigateTo } from '../../utils/utils';

// 进入试卷列表页面
const toPaperList = (type: string) => {
	navigateTo({
		url: "/pages/paperList/paperList",
		query: {
			type
		}
	});
};

// 进入错题列表页面
const toErrrQuestionList = () => {
	navigateTo({
		url: "/pages/errrQuestionList/errrQuestionList"
	});
};

const logout = () => {
	uni.removeStorageSync("TOKEN");
	uni.removeStorageSync("USER_ID");
	navigateTo({
		url: '/pages/login/login'
	});
};
</script>

<style lang="scss" scoped>
.container {
	padding: 20px;
	font-size: 14px;
	line-height: 24px;
}

.logout {
	margin-top: 160rpx;
}
</style>
